<div class="zs-body" data-ng-init="formInit('cms_link', {
		keyField:'id',
		randomFields:['id'],
		orderObject:{id:0} 
	}) && loadData('cms_link');setConHei();">

    <div class="zs-map-tool">
		<div class="location">
			<a >首页</a>
			<i class="right-arr"></i>
			<a >内容管理</a>
			<i class="right-arr"></i>
			<a >链接管理</a>
		</div>
		<div class="option">
			<input type="button" class="zs-btn orange" value="新建" 
				ng-click="addRow('cms_link') && openWindow('edit');"/>
			<input type="button" class="zs-btn orange" value="编辑" 
				ng-click="editRow('cms_link', cms_link.sRows[0]) && openWindow('edit')"/>
			<input type="button" class="zs-btn orange" value="删除 " 
				ng-click="delEntitys('cms_link')"/>
		</div>
	</div>
	<div class="zs-content" style="position:unset">
        <div class="zs-nice-tab idTabs">
        	<div class="tool item" style="margin-left:6px;">
                <span class="search-warpper">
                    <ag-Combotree class="zs-input" style="width:200px;height: 28px" 
                    	placeholder="所属站点"
						para="{ uDictionary:true,
								dictionary:'cms_site',
								pidField:'pid',
        						leafField:'leaf'}"
						ng-model="cms_link.queryObject['siteId']"/>
                </span>
            </div>
            <div class="operation item">
                <a class="ope-1" ng-click="loadData('cms_link')"></a>
                <a class="ope-2"></a>
            </div>
            <div class="switch">
            </div>
        </div>
        <div class="date-container">
            <div id="zpgwd">
                <div class="zs-data-table">
                    <div class="container">
                    	<table>
			                <thead>
			                    <tr>
			                        <th>
			                        	<input id="allCheckbox" type="checkbox"
			                        		ng-click="selectAll('cms_link','allCheckbox');">
			                        </th>
			                        <th>网站名称</th>
			                        <th>网站地址</th>
			                        <th>所属站点</th>
			                        <th>推荐</th>
			                        <th>状态</th>
			                    </tr>
			                </thead>
			                <tbody>
			                    <tr ng-repeat="r in cms_link.datas">
					                <td><input type="checkbox"
						                    ng-click="selectRow('cms_link',r);"
						                    ng-model="r.selected" />
					                </td>
					                <td>
					                    <a ng-click="editRow('cms_link',r) && openWindow('edit');">
					                        <label ng-bind="r.linkName"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('cms_link',r) && openWindow('edit');">
					                        <label ng-bind="r.linkAddress"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('cms_link',r) && openWindow('edit');">
					                        <label ng-bind="r.siteName"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('cms_link',r) && openWindow('edit');">
					                        <label ng-bind="r.recommend | asChineseBool"></label>
					                    </a>
					                </td>
					                <td>
					                    <a ng-click="editRow('cms_link',r) && openWindow('edit');">
					                        <label ng-bind="r.stateName"></label>
					                    </a>
					                </td>
					            </tr>
			                </tbody>
			            </table>
                    </div>
                </div>
                <div class="zs-pagination-box">
                    <ag-Page fn='cms_link'></ag-Page>
                </div>
            </div>
        </div>
        <div ag-Window id="edit" title="友情链接管理编辑" width='660px' height='280px'>
	        <div class="zs-form-tab ibox">
	        	<form name="form" novalidate>
				    <table width="100%">
				        <tbody>
		                    <tr>
		                    	<td class="text" width="20%">*所属站点</td>
		                        <td class="left" width="30%">
		                        	<span>
					                    <ag-Combotree class="zs-input" style="width:183px;height: 28px"
											para="{ uDictionary:true,
													dictionary:'cms_site',
													pidField:'pid',
		                    						leafField:'leaf'}"
											ng-model="cms_link.editRow.siteId"
											text-Value="cms_link.editRow.siteName"/>
		                        	</span>
		                        </td>
		                        <td class="text" width="20%">*网站名称</td>
		                        <td class="left" width="30%"><input type="text"
		                            ng-model="cms_link.editRow.linkName"
		                            class="zs-input" required></td>
		                    </tr>
		                    <tr>
		                        <td class="text" width="20%">*网站地址</td>
		                        <td colspan="3" class="left" width="80%"><input type="text"
		                            ng-model="cms_link.editRow.linkAddress"
		                            class="zs-input" required></td>
		                    </tr>
		                    <tr>
		                        <td class="text" width="20%">图片LOGO</td>
		                        <td colspan="3" class="left" width="80%">
		                        	<ag-Upload ng-model="cms_link.editRow.pictureAddress" 
		                        		para="{filters:[{title:'图片', extensions:'jpg,png'}]}"></ag-Upload>
		                        </td>
		                    </tr>
		                    <tr>
		                    	<td class="text" width="20%">站长Email</td>
		                        <td colspan="3" class="left" width="80%"><input type="text"
		                            class="zs-input" ng-model="cms_link.editRow.email"></td>
		                    </tr>
		                    <tr>
		                        <td class="text" width="20%">*状态</td>
		                        <td class="left" width="30%">
		                        	<ag-Combobox class="zs-input" style="width:183px;height: 28px" 
										para="{ uDictionary:true,
												dictionary:'cms_valid'}"
										ng-model="cms_link.editRow.state"
										text-Value="cms_link.editRow.stateName"/>
		                       	</td>
		                       	<td class="text" width="20%"></td>
		                        <td class="left" width="30%">
		                        	<input type="checkbox" ng-model="cms_link.editRow.recommend"
		                        		ng-true-value="true" ng-false-value="false" value='false' />
		                        	推荐 
		                        </td>
		                    </tr>
		                    <tr>
		                        <td class="text" width="20%">网站描述</td>
		                        <td colspan="3" class="left" width="80%"><input type="text"
		                            class="zs-input" ng-model="cms_link.editRow.describe"></td>
		                    </tr>
				        </tbody>
				        <tfoot>
				            <tr>
				                <td colspan="4">
				                    <input type="button" name="ok" value="保存" class="zs-btn c-red"
				                    	ng-click="formValidate(form) && save('cms_link', cms_link.editRow, saveCloseWindow)"/>
				                    <input type="button" name="ok" value="取消" class="zs-btn c-green" 
				                    	ng-click="closeWindow('edit')" />
				                </td>
				            </tr>
				        </tfoot>
				    </table>
				</form>
			</div>
	    </div>
	</div>
</div>